#1 string[i:j:k] i 从哪里开始 j 到哪里结束 k 每隔几个
#2 格式化字符串

s1 = "hello"
s2 = "hello world"
s1 in s2
print(s1 in s2)  # s2是否包含s1
print(s1 not in s2)

s1 == s2
print(s1 == s2)
print(s1 != s2)
# string[i:j:k] i 从哪里开始 j 到哪里结束 k 每隔几个
s2[0]  # 索引 0，1，2-----    -1 ，-2 ----
print(s2[0])

s2[0:4]
print(s2[0:4])

s2[4:]
print(s2[4:])
s2[::2]
print(s2[::2])

#格式化字符串
say3 = 'three are 5 monkey in the tree'
say3 = 'three are 3 monkey in the tree'
d1 = (2,"tree")
d2 = (4,"water")
say3 = 'three are %d monkey in the %s!'
#say3 =  say3 % (3,"tree")
print(say3 )
print(say3 % d1)
print(say3 % d2)